<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<script type="text/javascript">
		function print(){
			document.getElementById("con").innerHTML+="乐";
			T=setTimeout(print,10);
		}
		function fun1(){
			print();
		}
		function fun2(){
			clearTimeout(T);
		}
		function fun3(){
			S=setInterval(function(){
				document.getElementById("con").innerHTML+="乐";
		},10)
		}
		function fun4(){
			clearInterval(S);
		}
	</script>
	<body>
		<button onclick="fun1()">开始</button>
		<button onclick="fun2()">停止</button>
		<button onclick="fun3()">开始</button>
		<button onclick="fun4()">停止</button>
		
		<div id="con">
			
		</div>
	</body>
</html>
